import { post } from 'plugins/axios'

export function login ({state, commit}) {
  post('/api/token/', {
    username: state.form.username,
    password: state.form.password
  }).then((response) => {
    commit('logined', response)
  }).catch((error) => {
    commit('fail', error)
  })
}
